home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
ctutor.exe
/
SOURCE
/
ENUM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-15
|
762b
|
39 lines
/* Chapter 6 - Program 6 - ENUM.C */
#include "stdio.h"
void main()
{
enum {WIN, TIE, BYE, LOSE, NO_SHOW} result;
enum {SUN, MON, TUE, WED, THU, FRI, SAT} days;
result = WIN;
printf(" WIN = %d\n", result);
result = LOSE;
printf(" LOSE = %d\n", result);
result = TIE;
printf(" TIE = %d\n", result);
result = BYE;
printf(" BYE = %d\n", result);
result = NO_SHOW;
printf("NO_SHOW = %d\n\n", result);
for(days = MON ; days < FRI ; days++)
printf("The day code is %d\n", days);
}
/* Result of execution
WIN = 0
LOSE = 3
TIE = 1
BYE = 2
NO SHOW = 4
The day code is 1
The day code is 2
The day code is 3
The day code is 4
*/